import React, { useEffect, useState } from "react";

export default function HooksSync() {
  const [count, setCount] = useState(0);

  function myEffect() {
    const times = setInterval(() => {
      // console.log(count);
      setCount((x) => x + 1);
    }, 1000);
    return () => clearInterval(times)
  }
  // useEffect(myEffect, [count]);
  return <div>{count}</div>;
}